<#assign channelId = 11 />
<#assign pageHeader>
</#assign>
<#assign pageContent>
    <div class="body-wrap">
        <div class="type-box white-bg">
            <div class="content-wrap">
                <#if categoryRoots?? && categoryRoots?size gt 0>
                    <div class="clearfix">
                        <span>专业：</span>
                        <ul class="fl">
                            <a title="不限" href="/document/list.html?categoryId=0">
                                <li <#if params.categoryId==0>class="active"</#if>>不限</li>
                            </a>
                            <#list categoryRoots as category>
                                <a  title="${category.categoryName}" href="/document/list.html?categoryId=${category.categoryId}">
                                    <li <#if categoryRootId==category.categoryId>class="active"</#if>>${category.categoryName}</li>
                                </a>
                            </#list>
                        </ul>
                    </div>
                </#if>
                <#if categoryChildren?? && categoryChildren?size gt 0>
                    <div class="clearfix">
                        <span>分类：</span>
                        <ul class="fl">
                            <a title="不限" href="/document/list.html?categoryId=${categoryRootId!}">
                                <li <#if params.categoryId==categoryRootId>class="active"</#if>>不限</li>
                            </a>
                            <#list categoryChildren as child>
                                <a title="${child.categoryName}" href="/document/list.html?categoryId=${child.categoryId}">
                                    <li <#if categoryParentId==child.categoryId>class="active"</#if>>${child.categoryName}</li>
                                </a>
                            </#list>
                        </ul>
                    </div>
                </#if>
                <#if categorySons?? && categorySons?size gt 0>
                    <div class="clearfix">
                        <span>子类：</span>
                        <ul class="fl">
                            <a title="不限" href="/document/list.html?categoryId=${categoryParentId!}">
                                <li <#if params.categoryId==categoryParentId>class="active"</#if>>不限</li>
                            </a>
                            <#list categorySons as sonCategory>
                                <a title="${sonCategory.categoryName}" href="/document/list.html?categoryId=${sonCategory.categoryId}">
                                    <li <#if params.categoryId==sonCategory.categoryId>class="active"</#if>>${sonCategory.categoryName}</li>
                                </a>
                            </#list>
                        </ul>
                    </div>
                </#if>
            </div>
        </div>
        <div class="filter-box white-bg mb-20">
            <div class="content-wrap">
                <div class="fl">
                    <span class="item <#if params.orderBy == 0>active</#if>" onclick="setOrderBy(0)">综合</span>
                    <span class="division">|</span>
                    <span class="item <#if params.orderBy == 1>active</#if>" onclick="setOrderBy(1)">热门</span>
                    <span class="division">|</span>
                    <span class="item <#if params.orderBy == 2>active</#if>" onclick="setOrderBy(2)">下载</span>
                </div>
                <div class="fr">
                    <div class="layui-form">
                        <label for="isFree">
                            <input type="checkbox" onclick="setIsFree()" id="isFree" value="1" title="免费" lay-skin="primary" <#if params.isFree gt 0 >checked</#if>>
                        </label>
                        <label for="isVip">
                            <input type="checkbox" onclick="setIsVip()" id="isVip" value="1" title="VIP" lay-skin="primary" <#if params.levelId?? && params.levelId gt 0 >checked</#if>>
                        </label>
                    </div>
                </div>
            </div>
        </div>
        <div class="content-wrap">
             <div class="articles-list" style="min-height: auto">
                <#if documentList?? && documentList?size gt 0 >
                    <#list documentList as item>
                            <div class="list-items">
                                <div class="list-item">
                                    <div class="list-content">
                                        <a href="/document/view/${item.id}.html" target="_blank" class="list-article-img"><img lay-src="${item.cover!}" alt=""></a>
                                        <a href="/document/view/${item.id}.html" target="_blank" class="list-article-title">${item.title!!}</a>
                                        <#assign tags = item.tags?split('，') />
                                        <div class="list-article-info">
                                            <#if tags?? && tags?size gt 0>
                                                     <#list tags as tag><span class="file-type" style="margin-right: 5px;">${tag!}</span></#list>
                                                <#else>
                                                    <span class="file-type" style="margin-right: 5px;">资料</span>
                                            </#if>
                                        </div>
                                        <div class="list-article-price">
                                            <#if item.price gt 0>
                                                ￥${item.price/100}
                                            <#else>
                                                免费
                                            </#if>
                                        </div>
                                        <div class="list-article-type">
                                            <strong>${item.categoryName!}</strong>
                                        </div>
                                    </div>
                                </div>
                            </div>
                    </#list>
                <#else>
                    <div class="data-null">
                        <i class="icon-data-null"></i>
                        <p>小编还没有整理内容哦，去看看其它吧</p>
                    </div>
                </#if>
            </div>
        </div>
        <!--分页 s-->
        <#if documentList?? && documentList?size gt 0 >
            <div id="list-ft" class="page-box content-wrap"></div>
        </#if>
        <!--分页 e-->
    </div>
</#assign>
<#assign pageFooter>
    <script type="text/javascript">
        var categoryId = ${params.categoryId};
        var isFree = ${params.isFree};
        var levelId = ${params.levelId};
        var orderBy = ${params.orderBy};
        var pageSize = ${page.pageSize};
        var currentPage = ${page.currentPage};
        var totalRecords = ${page.totalRecords};
        $(function () {
            layui.laypage.render({
                elem: 'list-ft'
                , theme: '#1E9FFF'
                , limit: pageSize
                , curr: currentPage
                , count: totalRecords //数据总数，从服务端得到
                , jump: function (obj, first) {
                    //console.log(obj.curr); //得到当前页，以便向服务端请求对应页的数据。
                    //console.log(obj.limit); //得到每页显示的条数
                    //首次不执行
                    if (!first) {
                        jumpPage(obj.curr);
                        return false
                    }
                }
            });
        });
    </script>
    <script src="/static/js/document/document.js"></script>
</#assign>
<#include "../layouts/layout.ftl">

